package cevent.source.cloudcenter.server.exception;/**
 * Created by Cevent on 2021/5/23.
 */

/**
 * @author cevent
 * @description 系统模块异常捕获
 * @date 2021/5/23 9:27
 */
public class SystemException extends RuntimeException {
    private SystemExceptionCode systemExceptionCode;
    //有参构造，get、set方法
    public SystemException(SystemExceptionCode code){
        super(code.getDesc());
        this.systemExceptionCode=code;
    }

    public SystemExceptionCode getSystemExceptionCode() {
        return systemExceptionCode;
    }

    public void setSystemExceptionCode(SystemExceptionCode code) {
        this.systemExceptionCode = code;
    }
    /**不写入堆栈，提高性能
     * 抛出业务异常时，不打印堆栈信息，可以提高性能。同时没业务异常不需要看堆栈信息
     * @return
     */
    @Override
    public Throwable fillInStackTrace() {
        return this;
    }
}
